<template>
	<view class="content">
		<view style="position: fixed;left: 0;top: 0;right: 0;z-index: 100;">
			<view class="index-nav">
			    <text 
				  :class="{navtitlecss:navtitle==='gr'}" 
				  @click="navpersonal('gr')" class="index-nav-title">
				  个人测评
				  <text v-if="navtitle==='gr'" class="nav-i"></text>
				</text>
				<text 
				 :class="{navtitlecss:navtitle==='td'}" 
				 @click="navteam('td')" class="index-nav-title">
				 团队测评
				 <text v-if="navtitle==='td'" class="nav-i"></text>
				</text>
			</view>
		</view>
		<view>
			<view v-if="navtitle==='gr'"><personal></personal></view>
			<view v-if="navtitle==='td'"><team></team></view>
		</view>
	</view>
</template>
<script>
	import 	personal from '../../components/index/personal.vue'
	import 	team from '../../components/index/team.vue'
	export default {
		components:{
			personal,
			team
		},
		data() {
			return {
				navtitle:'gr'
			}
		},
		onLoad() {

		},
		methods: {
			navpersonal(item){
				this.navtitle = item
				uni.setNavigationBarTitle({
					title: '儿童感统测评'
				})
			},
			navteam(item){
				this.navtitle = item
				uni.setNavigationBarTitle({
					title: '儿童感统测试'
				})
			}
		}
	}
</script>

<style>
	.index-nav{
		height: 90upx;
		line-height: 90upx;
		display: flex;
		border-bottom:1px solid #f8f8f8;
		background: #fff;
	}
	.index-nav .index-nav-title{
		font-size: 32upx;
		width: 50%;
		text-align: center;
		color: red(51,51,51);
		position: relative;
	}
	.navtitlecss{
		color: #ff7200!important;
	}
	.index-nav .index-nav-title .nav-i{
		margin: 0;
		left: 50%;
		transform: translate(-50%, -50%);
		position: absolute;
		height: 5upx;
		width: 50upx;
		background:#ff7200;
		text-align: center;
		bottom:0upx;
		border-rasius:1upx;
	}
</style>
